package com.example.xml;

import com.example.xml.service.AccountService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName:testXml
 * Package:com.example.xml
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/11-22:51
 * @Version:v1.0
 */
public class testXml {

    @Test
    public void testXml() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-bank.xml");
        AccountService accountService = applicationContext.getBean("accountService", AccountService.class);

        try {
            accountService.transfer("act-002","act-001",10000.0);
            System.out.println("转账成功");
        }catch (Exception e){
            System.out.println("转账失败");
            e.printStackTrace();
        }

    }
}
